import {ObjectDto, ObjectDtoInterface} from "../../../services/sqliteDB/object.dto";
import { TableColumnType } from "../../../services/sqliteDB/object.dto";
import {SyncStatus} from "../../sync-status";

export class InspectionTasksDto extends ObjectDto implements ObjectDtoInterface {

    public id: string = null; // 任务Id
    public taskNo: string = null; // 检修任务编号
    public content: string = null; // 任务内容
    public plannedDate: number = null; // 计划检修的日期
    public pathForWorkTicket: string = null; // 工作票的本地路径
    public attachmentIdForWorkTicket: string = null; // 工作票的附件id
    public twoTicketsCreatedTime: number = null; // 两票开出时间
    public inspectionRecordsSubmittedTime: number = null; // 勘察记录提交时间
    public finishedTime: number = null; // 检修完成时间
    public status: number = null; // 检修状态（0： 待勘察，1： 待审核， 2： 待检修  3： 完成
    public syncStatus: SyncStatus = SyncStatus.None;       // 同步状态：   （0: 从来没上传, 1: 上传成功, 2: 正在上传, 3: 上传失败)

    constructor() {
        super();
    }

    table() {
        return {
            tableName: "InspectionTasks",
            tableConstructor: {
                id: `${TableColumnType.text} ${TableColumnType.unique}`,
                taskNo: TableColumnType.text,
                content: TableColumnType.text,
                plannedDate: TableColumnType.int,
                pathForWorkTicket: TableColumnType.text,
                attachmentIdForWorkTicket: TableColumnType.text,
                twoTicketsCreatedTime: TableColumnType.int,
                inspectionRecordsSubmittedTime: TableColumnType.int,
                finishedTime: TableColumnType.int,
                status: TableColumnType.int,
                syncStatus: TableColumnType.int
            }
        };
    }

}
